package meituan1.problem2;

import java.util.Scanner;

/**
 *
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] info = new int[3];
        String[] infoTemp = sc.nextLine().split(" ");
        for (int i = 0; i < 3; i++) {
            info[i] = Integer.parseInt(infoTemp[i]);
        }
        int rounds = info[0];
        int cost = Math.min(info[1], info[2]);
        int FCount = 0;
        int totalCost = 0;
        String[] matchResult = sc.nextLine().split("");
        for(String s: matchResult){
            if(s.equals("F")){
                FCount++;
                if(FCount == 3){
                    totalCost += cost;
                    FCount = 0;
                }
            }else {
                FCount = 0;
            }
        }
        System.out.println(totalCost);
    }
}
